<template>
  <div>
    <van-nav-bar fixed title="浏览历史" left-arrow @click-left="onClickLeft" />
    <div style="height: 46px"></div>
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
      <recipe-cell v-for="i in 15" :key="i"></recipe-cell>
    </van-list>
  </div>
</template>

<script>
import RecipeCell from "@/components/RecipeCell.vue";
export default {
  components: { RecipeCell },
  data() {
    return {
      loading: false,
      finished: false,
    };
  },
  methods: {
    onLoad() {
      // 异步更新数据
      // setTimeout 仅做示例，真实场景中一般为 ajax 请求
      // 加载状态结束
      // this.loading = false;
      // // 数据全部加载完成
      // if (this.data.length >= 40) {
      //   this.finished = true;
      // }
    },
    onClickLeft() {
      return this.$router.go(-1);
    },
  },
};
</script>

RecipeCell
<style scoped>
:deep(.van-nav-bar .van-icon) {
  color: #000;
}
</style>

<style lang="scss" scoped></style>
